import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * 在父类Base中定义了计算方法calculate()，该方法用于计算两个数的乘积（X*Y）。
 * 请在子类Sub中重写该方法，将计算逻辑由乘法改为除法（X/Y）。注意，当分母为0时输出“Error”。
 * User: 15085202591
 * Date: 2022-12-17
 * Time: 20:37
 */
class Base2{
    private int x;
    private int y;

    public Base2(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public void calculate(){
        System.out.println(getX() * getY());
    }
}
class Sub2 extends Base2{
    public Sub2(int x, int y) {
        super(x, y);
    }
    public void calculate(){
        if(super.getY() == 0){
            System.out.println("Error");
        }else {
            System.out.println(getX()/getY());
        }
    }
}
public class Demo3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()){
            int x = sc.nextInt();
            int y = sc.nextInt();
            Sub2 sub2 = new Sub2(x,y);
            sub2.calculate();
        }
    }
}
